home *** CD-ROM | disk | FTP | other *** search
/ AmigActive 10 / AACD 10.iso / AACD / Games / MAME / src / vidhrdw / canyon.c < prev    next >
C/C++ Source or Header  |  2000-01-06  |  2KB  |  82 lines

  1. /***************************************************************************
  2.  
  3.   vidhrdw.c
  4.  
  5.   Functions to emulate the video hardware of the machine.
  6.  
  7. ***************************************************************************/
  8.  
  9. #include "driver.h"
  10. #include "vidhrdw/generic.h"
  11.  
  12. /***************************************************************************
  13.  
  14.   Draw the game screen in the given osd_bitmap.
  15.   Do NOT call osd_update_display() from this function, it will be called by
  16.   the main emulation engine.
  17.  
  18. ***************************************************************************/
  19. void canyon_vh_screenrefresh(struct osd_bitmap *bitmap,int full_refresh)
  20. {
  21.     int offs;
  22.  
  23.     /* for every character in the Video RAM, check if it has been modified */
  24.     /* since last time and update it accordingly. */
  25.     for (offs = videoram_size - 1;offs >= 0;offs--)
  26.     {
  27.         if (full_refresh || dirtybuffer[offs])
  28.         {
  29.             int charcode;
  30.             int sx,sy;
  31.  
  32.             dirtybuffer[offs]=0;
  33.  
  34.             charcode = videoram[offs] & 0x3F;
  35.  
  36.             sx = 8 * (offs % 32);
  37.             sy = 8 * (offs / 32);
  38.             drawgfx(tmpbitmap,Machine->gfx[0],
  39.                     charcode, (videoram[offs] & 0x80)>>7,
  40.                     0,0,sx,sy,
  41.                     &Machine->drv->visible_area,TRANSPARENCY_NONE,0);
  42.         }
  43.     }
  44.  
  45.     /* copy the character mapped graphics */
  46.     copybitmap(bitmap,tmpbitmap,0,0,0,0,&Machine->drv->visible_area,TRANSPARENCY_NONE,0);
  47.  
  48.     for (offs=0; offs<2; offs++)
  49.     {
  50.         int sx, sy;
  51.         int pic;
  52.         int flipx;
  53.  
  54.         sx = 27*8 - spriteram[offs*2+1];
  55.         sy = 30*8 - spriteram[offs*2+8];
  56.         pic = spriteram[offs*2+9];
  57.         if (pic & 0x80)
  58.             flipx=0;
  59.         else
  60.             flipx=1;
  61.  
  62.         drawgfx(bitmap,Machine->gfx[1],
  63.                 (pic & 0x18) >> 3, offs,
  64.                 flipx,0,sx,sy,
  65.                 &Machine->drv->visible_area,TRANSPARENCY_PEN,0);
  66.     }
  67.  
  68.     /* Draw the bombs as 2x2 squares */
  69.     for (offs=2; offs<4; offs++)
  70.     {
  71.         int sx, sy;
  72.  
  73.         sx = 31*8 - spriteram[offs*2+1];
  74.         sy = 31*8 - spriteram[offs*2+8];
  75.  
  76.         drawgfx(bitmap,Machine->gfx[2],
  77.                 0, offs,
  78.                 0,0,sx,sy,
  79.                 &Machine->drv->visible_area,TRANSPARENCY_PEN,0);
  80.     }
  81. }
  82.